from .base import *

############### 基础配置 ################
ENV_NAME = 'LOCAL'
FILES_DIR = os.environ.get('FILES_DIR') or './tmp'
LOG_DIR = os.environ.get('LOG_DIR') or os.path.join(FILES_DIR, 'logs')
if not os.path.exists(FILES_DIR):
    os.makedirs(FILES_DIR)
if not os.path.exists(LOG_DIR):
    os.makedirs(LOG_DIR)
LOG_LEVEL = os.environ.get('LOG_LEVEL') or 'debug'

STATIC_PATH = 'static'
UPLOAD_PATH = '%s/upload' % FILES_DIR

# database
DB_HOST = os.environ.get('XP_DB_HOST') or 'localhost'
DB_NAME = os.environ.get('XP_DB_NAME') or 'newpay_dev'
DB_USER = os.environ.get('XP_DB_USER') or 'foo'
DB_PASS = os.environ.get('XP_DB_PASS') or '123456'


SM_PRI_KEY = os.environ.get('SM_PRI_KEY') or '2AA970DCA2FE9F295E7E19794403080938C77DA6CBC2165D7F9682987D0C863'
SM_PUB_KEY = os.environ.get('SM_PUB_KEY') or '6783C2C2706E0C27B82489B8E550B2D18A41DC8C7D9ED22E7B31DC8346C658B5D80111F525D23AC3A280152A40CB41214A8903832E01A6B779E0A331A4CA671F'
SECRET_KEY = os.environ.get('SECRET_KEY') or '8a81609a885ae99a70f399548f34c2f5'
    
############### 安全配置 ################

ALLOWED_HOSTS = [
    'localhost',
    '192.168.59.22'
]

ALLOWED_URIS = ["/static*", 
                "/docs*", "/redoc", "*/openapi.json", 
                "/debug*", 
                "/login/",
                '/api*'
                ]